package com.lemon.cloud.comm.model;

/**
 * 响应码、提示信息
 * @author HuangDS
 */
public enum ResultCode {

    /**
     * OAuth 2.0 异常值定义，10开头
     */
    UNAUTHORIZED(10401, "授权异常"),
    INVALID_CLIENT(10402, "无效的客户端"),
    UNAUTHORIZED_CLIENT(10403, "授权客户端失败"),
    USERNAME_OR_PASSWORD_ERROR(10404,"用户名或密码错误"),
    INVALID_SCOPE(10405, "不支持的权限范围"),
    INVALID_REQUEST(10407,"请求异常"),
    REDIRECT_MISMATCH(10408,"Redirect URI异常"),
    UNSUPPORTED_GRANT_TYPE(10409, "不支持的认证模式"),
    UNSUPPORTED_RESPONSE_TYPE(10410, "不支持的相应类型"),
    USER_DENIED_AUTHORIZATION(10411, "用户拒绝授权"),
    TOKEN_EXPIRE(10412,"token过期"),
    PHONE_OR_CODE_ERROR(10413,"登录失败,请输入正确验证码"),
    BAD_CREDENTIALS_ERROR(10414,"客户端信息错误，Basic认证失败"),
    NO_PERMISSION(401,"无权限访问"),

    REQUEST_SUCCESS(200,"请求成功！"),

    SERVICE_EXCEPTION(2000,"业务处理异常！"),
    PARAMETER_FAIL(2001,"参数错误！"),

    SERVER_FALLBACK(3001,"服务降级了........"),
    SERVER_LIMIT(3002,"网络拥挤，请稍后再试..."),
    NO_REPEATABLE_SUBMIT(3002,"请勿重复提交........"),

    //////////////移动端///////////////

    FILE_MUCH_MAX(4001,"文件过大，请压缩后再上传！"),

    PHONE_ERROR(4002,"请输入正确手机号"),

    APP_PHONE_UNREGISTERED(4003,"手机号未注册"),

    APP_ID_ERROR(4004,"appId错误"),

    ;


    private final int code;

    private final String msg;

    private ResultCode(int code, String msg){
        this.code=code;
        this.msg=msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
